<?php echo $this->
	Html->script(array( 'print' )); ?>
	<div id="areaImprimir">
    <div class="grid12">
       <h4>Detalle de los montos mayores, menores y sin  monto </h4>
    </div>
    <div class="grid12">
		
			<div class="widget">
				<div class="whead">
					<h6>
						Ultimos 20 Montos Mayores
					</h6>
					<div class="clear">
					</div>
				</div>
				<table cellpadding="0" cellspacing="0" width="100%" class="tDefault">
					<thead>
						<tr>
							<td>
								Item
							</td>
							<td>
								Orden de Compra
							</td>
                            <td>
								Descripcion
							</td>
                            <td>
								Monto
							</td>
                            <td>
                               Unidad
                            </td>
                            <td>
								Acciones
							</td>
                            
						</tr>
					</thead>
					<tbody>
						<?php $i=1; ?>
							<?php foreach ($datosPo as $o): ?>
								<tr>
                                    <?php $id = $o['Ordene']['id']; ?>
									<td>
										<?php echo $i; $i++; ?>
									</td>
									<td>
										<?php echo $o[ 'Ordene'][ 'nombre']; ?>
									</td>
                                    <td>
										<?php echo $o[ 'Ordene'][ 'descripcion']; ?>
									</td>
                                    <td>
										<?php //echo $o[ 'Ordene'][ 'monto']; 
                                        $montoP = $o['Ordene']['monto'];
                                        $modMontoPrin = $this->Number->format($montoP, array(
                                            'places' => 2,
                                            'before' => ' ',
                                            'escape' => false,
                                            'decimals' => '.',
                                            'thousands' => ','
                                        ));
                                        echo $modMontoPrin;
                                        ?>
									</td>
                                    <td>
                                       <?php echo $o['Ordene']['tipo_moneda'] ?>
                                    </td>
                                    <td>
                                    <?php echo $this->Html->link('DETALLE', array('action' => 'detalle', $id)); ?> 
                          
                                    </td>
                                    
								</tr>
								<?php endforeach; ?>
					</tbody>
				</table>

			</div>
            
            
		</div>
        
         <div class="grid12">
		
			<div class="widget">
				<div class="whead">
					<h6>
						Ultimos 20 Montos Menores diferentes de monto cero
					</h6>
					<div class="clear">
					</div>
				</div>
				<table cellpadding="0" cellspacing="0" width="100%" class="tDefault">
					<thead>
						<tr>
							<td>
								Item
							</td>
							<td>
								Orden de Compra
							</td>
                            <td>
								Descripcion
							</td>
                            <td>
								Monto
							</td>
                            <td>
                               Unidad
                            </td>
                            <td>
								Acciones
							</td>
                            
						</tr>
					</thead>
					<tbody>
						<?php $i=1; ?>
							<?php foreach ($datosPorev as $o): ?>
								<tr>
                                    <?php $id = $o['Ordene']['id']; ?>
									<td>
										<?php echo $i; $i++; ?>
									</td>
									<td>
										<?php echo $o[ 'Ordene'][ 'nombre']; ?>
									</td>
                                    <td>
										<?php echo $o[ 'Ordene'][ 'descripcion']; ?>
									</td>
                                    <td>
										<?php //echo $o[ 'Ordene'][ 'monto']; 
                                        $montoP = $o['Ordene']['monto'];
                                        $modMontoPrin = $this->Number->format($montoP, array(
                                            'places' => 2,
                                            'before' => ' ',
                                            'escape' => false,
                                            'decimals' => '.',
                                            'thousands' => ','
                                        ));
                                        echo $modMontoPrin;
                                        ?>
									</td>
                                    <td>
                                       <?php echo $o['Ordene']['tipo_moneda'] ?>
                                    </td>
                                    <td>
                                    <?php echo $this->Html->link('DETALLE', array('action' => 'detalle', $id)); ?> 
                          
                                    </td>
                                    
								</tr>
								<?php endforeach; ?>
					</tbody>
				</table>

			</div>
            
            
		</div>
        <div class="grid12">
		
			<div class="widget">
				<div class="whead">
					<h6>
						Ultimos 20 Montos ceros
					</h6>
					<div class="clear">
					</div>
				</div>
				<table cellpadding="0" cellspacing="0" width="100%" class="tDefault">
					<thead>
						<tr>
							<td>
								Item
							</td>
							<td>
								Orden de Compra
							</td>
                            <td>
								Descripcion
							</td>
                            <td>
								Monto
							</td>
                            <td>
                               Unidad
                            </td>
                            <td>
								Acciones
							</td>
                            
						</tr>
					</thead>
					<tbody>
						<?php $i=1; ?>
							<?php foreach ($datosCeros as $o): ?>
								<tr>
                                    <?php $id = $o['Ordene']['id']; ?>
									<td>
										<?php echo $i; $i++; ?>
									</td>
									<td>
										<?php echo $o[ 'Ordene'][ 'nombre']; ?>
									</td>
                                    <td>
										<?php echo $o[ 'Ordene'][ 'descripcion']; ?>
									</td>
                                    <td>
										<?php //echo $o[ 'Ordene'][ 'monto']; 
                                        $montoP = $o['Ordene']['monto'];
                                        $modMontoPrin = $this->Number->format($montoP, array(
                                            'places' => 2,
                                            'before' => ' ',
                                            'escape' => false,
                                            'decimals' => '.',
                                            'thousands' => ','
                                        ));
                                        echo $modMontoPrin;
                                        ?>
									</td>
                                    <td>
                                       <?php echo $o['Ordene']['tipo_moneda'] ?>
                                    </td>
                                    <td>
                                    <?php echo $this->Html->link('DETALLE', array('action' => 'detalle', $id)); ?> 
                          
                                    </td>
                                    
								</tr>
								<?php endforeach; ?>
					</tbody>
				</table>

			</div>
            
            
		</div>

	</div>
    
	<div class="grid12">
    <div class="widget">
                        <div class="whead"><h6>Acciones</h6><div class="clear"></div></div>
                        <div class="body" align="center">
                            <?php //echo $this->Html->link("Volver &raquo;", array('controller'=>'Publicos', 'action'=>'generales'), array('class'=>'buttonS bLightBlue', 'escape' => FALSE)); ?>
                            <a href="javascript:history.go(-1)" class="buttonS bLightBlue">Atras</a>
                            <input type="button" class="buttonS bGreen" value="Imprimir" id="btnImprimir" />
                        </div>
    </div>
   </div>
	<script type="text/javascript">
		
		

$(document).ready(function() {

$("#btnImprimir").click(function() {
//console.log('click');
printElem({ leaveOpen: true, printMode: 'popup' });
//printElem({ overrideElementCSS: ['http://www.epcm.com/css/printable.css ] });
});


});
function printElem(options){
$('#areaImprimir').printElement(options);
}



	
	</script>